﻿@model IEnumerable<FairyWorld.Models.User>

@{
    ViewBag.Title = "Contact";
    Layout = "~/Views/Shared/UserLayout.cshtml";
}

<link href="@Url.Content("~/Content/themes/messenger/messenger.css")" rel="stylesheet" type="text/css"/>
<link href="@Url.Content("~/Content/themes/messenger/messenger-theme-future.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/messenger.min.js")" type="text/javascript"></script>
<link  href="http://fonts.googleapis.com/css?family=Reenie+Beanie:regular" rel="stylesheet" type="text/css">

<script>
    function send() {
        var postModel = "";
        $(".check").each(
            function () {
                if ($(this).attr("checked") == "checked") {
                    postModel += $(this).attr("id") + "_";
                }
            });

        $.post("/User/Contact", {
            "data": postModel, "letter": $("#information").val()
        }, function () {
            $("#information").val("");
            $.globalMessenger().post("私信已发送成功！");
        });
    }

    function sendemail() {
        var emailaddresses = "";
        $(".checkemail").each(
            function () {
                if ($(this).attr("checked") == "checked") {
                    emailaddresses += $(this).attr("name") + ";";
                }
            });
        window.location.href = "/User/SendEmail?emailaddresses=" + emailaddresses;
    }
</script>
<style type="text/css">
*{
  margin:0;
  padding:0;
}
body .notebox {
  font-family:arial,sans-serif;
  font-size:100%;
  color:#fff;
}
.notebox h2,p{
  font-size:100%;
  font-weight:normal;
}
.notebox ul,li{
  list-style:none;
}
.notebox ul{
  overflow:hidden;
  padding:1em;
}
.notebox ul li .note{
  text-decoration:none;
  color:#000;
  background:#ffc;
  display:block;
  height:10em;
  width:10em;
  padding:1em;
  -moz-box-shadow:5px 5px 5px rgba(20,20,20,1);
  -webkit-box-shadow: 5px 5px 5px rgba(20,20,20,.7);
  box-shadow: 5px 5px 5px rgba(20,20,20,.7);
  -moz-transition:-moz-transform .15s linear;
  -o-transition:-o-transform .15s linear;
  -webkit-transition:-webkit-transform .15s linear;
}
.notebox ul li{
  margin:1em;
  float:left;
}
.notebox ul li h2{
  font-size:140%;
  font-weight:bold;
  padding-bottom:10px;
}
.notebox ul li p{
  font-family:"Reenie Beanie",arial,sans-serif;
  font-size:180%;
}
.notebox ul li .note{
  -webkit-transform: rotate(-6deg);
  -o-transform: rotate(-6deg);
  -moz-transform:rotate(-6deg);
}
.notebox ul li:nth-child(even) .note{
  -o-transform:rotate(4deg);
  -webkit-transform:rotate(4deg);
  -moz-transform:rotate(4deg);
  position:relative;
  top:5px;
  background:#cfc;
}
.notebox ul li:nth-child(3n) .note{
  -o-transform:rotate(-3deg);
  -webkit-transform:rotate(-3deg);
  -moz-transform:rotate(-3deg);
  position:relative;
  top:-5px;
  background:#ccf;
}
.notebox ul li:nth-child(5n) .note{
  -o-transform:rotate(5deg);
  -webkit-transform:rotate(5deg);
  -moz-transform:rotate(5deg);
  position:relative;
  top:-10px;
}
.notebox ul li .note:hover,.notebox ul li .note:focus{
  box-shadow:3px 3px 3px rgba(0,0,0,.7);
  -moz-box-shadow:3px 3px 3px rgba(0,0,0,.7);
  -webkit-box-shadow: 3px 3px 3px rgba(0,0,0,.7);
  -webkit-transform: scale(1.1);
  -moz-transform: scale(1.1);
  -o-transform: scale(1.1);
  position:relative;
  z-index:5;
}
.notebox ol{text-align:center;}
.notebox ol li{display:inline;padding-right:1em;}
.notebox ol li .note{color:#fff;}
</style>
<body>
    <div class="notebox">
    <ul>
        @foreach (var item in Model) {
            <li>
                <div class="note"> 
                        <h2>                        
                            @Html.DisplayFor(modelItem => item.username)
                        </h2>
                        <p>
                            @Html.DisplayFor(modelItem => item.phone)
                        </p>
                        <p>
                            @Html.DisplayFor(modelItem => item.email)
                        </p>
                        发送私信<input type="checkbox" class="check" id="@item.UserId" style="float:left"/>
                        发送邮件<input type="checkbox" class="checkemail" name="@item.email" style="float:right" />             
                </div>
            </li>
        }
    </ul>
    </div>
    <div class="input-append" style="padding-left:60px">
        <input class="input-xxlarge" id="information" type="text" placeholder="say something to TA ...">
        <button class="btn" type="button" onclick="send()">发送私信</button>
        <button class="btn" type="button" onclick="sendemail()">发送邮件</button>
    </div>

</body>
